package Day1.graph;

public class Circle extends Shape {
    private double r;

    public Circle(String color, double r) {
        super(color);
        this.r = r;
    }

    @Override
    public void draw() {
        super.draw();
        System.out.println("正在画圆形");
    }

    public double getArea() {
        return Math.PI * Math.pow(this.r, 2);
    }

    public double getR() {
        return this.r;
    }

    public void setR(double r) {
        this.r = r;
    }
}